import allure
from page_base.page_base import Base
from page_element.el_Roncoo import *
from utils.timer import sleep
import logging

class AddRole(Base):
    def addrole(self,rolename,rolecode,roledesc):
        with allure.step('点击角色管理'):
            self.click(Role.role_href)
        # 强制等待
        sleep(3)
        with allure.step('点击添加角色'):
            self.click(Role.role_input)
        with allure.step(f'输入角色名称：{rolename}'):
            self.send_keys(Role.role_name,rolename)
        with allure.step(f'输入角色编码：{rolecode}'):
            self.send_keys(Role.role_code,rolecode)
        with allure.step(f'输入角色描述：{roledesc}'):
            self.send_keys(Role.role_desc,roledesc)
        with allure.step('点击保存'):
            self.click(Role.role_submit)